// @algorithm @lc id=1000343 lang=cpp
// @title TVdhkn

#include "algm/algm.h"
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Solution {
public:
    vector<vector<int>> ans;
    vector<vector<int>> subsets(vector<int> &nums) {
        int n = nums.size();
        vector<int> temp;
        backtracking(n, 0, temp, nums);
        return ans;
    }

    void backtracking(int n, int index, vector<int> &temp, vector<int> &nums) {
        if (index == n) {
            ans.push_back(temp);
            return;
        }
        temp.push_back(nums[index]);
        backtracking(n, index + 1, temp, nums);
        temp.pop_back();
        backtracking(n, index + 1, temp, nums);
        return;
    }
};